 
package com.zkmonitor.common;

import java.util.HashMap;
import java.util.Map;

public enum Status {
    AGREE(10, "accepted"),

    REFUSE(-10, "refused"),

    PENDING(0, "pending"),

    DELETE(-100, "deleted");

    private static final Map<Integer, Status> LOOKUP = new HashMap<>();

    static {
        for (Status status : Status.values()) {
            LOOKUP.put(status.getValue(), status);
        }
    }

    private int value;
    private String description;

    Status(int value, String description) {
        this.value = value;
        this.description = description;
    }

    public static Status get(int value) {
        return LOOKUP.get(value);
    }

    public int getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }

}

